﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Samples.ServiceHosting.StorageClient;
using BusinessLogic.Tools;

namespace ZeCloud.Resto55.Business.Table
{
    public class RestoIndex : TableStorageEntity
    {
        // Partition Key : chaque mot du nom du restaurant
        // RowKey : RestoPK + RestoRK

        public string ValeurIndexe { get; set; }
        public string NomRestaurant { get; set; }
        public string VilleRestaurant { get; set; }
        public string RestoPartitionKey { get; set; }
        public string RestoRowKey { get; set; }
        public string UniqueId { get; set; }

        public RestoIndex()
        {
        }

        public RestoIndex(string valeurIndexe, string mot, string restoPK, string restoRK, string uniqueId)
        {
            PartitionKey = mot;
            RowKey = restoPK + "_" + restoRK;
            ValeurIndexe = valeurIndexe;

            RestoPartitionKey = restoPK;
            RestoRowKey = restoRK;
            UniqueId = uniqueId;
        }

        public RestoIndex(string valeurIndexe, string mot, Resto resto)
        {
            PartitionKey = mot;
            RowKey = resto.PartitionKey + "_" + resto.RowKey;
            ValeurIndexe = valeurIndexe;

            NomRestaurant = resto.nom;
            VilleRestaurant = resto.ville;
            RestoPartitionKey = resto.PartitionKey;
            RestoRowKey = resto.RowKey;

            UniqueId = resto.uniqueId;
        }

    }
}
